#pragma once 
#include "Object.h"
#include <functional>

class Animation
{
protected:
    SDL_Point pos_;
    uint32_t startTime_;
    uint8_t currentFrame_;
    uint8_t totalFrames_;
    uint8_t FPS_ = 10; // frames per second
    std::function<void()> finishCallback_;

public:
    Animation(SDL_Point pos);
    inline void SetFinishCallback(std::function<void()> callback) { finishCallback_ = callback; }
    virtual ~Animation();
    virtual bool Update(float dt);
    virtual void Render(SDL_Renderer* renderer) = 0;
};

class Explosion : public Animation
{
public:
    Explosion(SDL_Point pos, uint8_t totalFrames);
    void Render(SDL_Renderer* renderer) override;
};

class BirthAnimetion : public Animation
{
public:
    BirthAnimetion(SDL_Point pos);
    void Render(SDL_Renderer* renderer) override;
};